<%@ taglib uri="/WEB-INF/myfaces_html.tld" 	prefix="h" %>
<%@ taglib uri="/WEB-INF/myfaces_core.tld" 	prefix="f" %>
<%@ taglib uri="/WEB-INF/tomahawk.tld"     	prefix="t" %>
<%@ taglib uri="/WEB-INF/myfaces_sandbox.tld"   prefix="s" %>

<f:view>
    <jsp:include page="/intestazione.jsp">
        <jsp:param name="titolo" value="Gestione Cliente Dettaglio"/>
    </jsp:include>
    <jsp:include page="/menu.jsp"/>     
    <script language="javascript" src="./script/popup_full_center.js"></script>    
    <script language="javascript" src="./script/ripristinoSessione.js"></script>    
    <h:form binding="#{dettaglioClienteDett.form}">          
        <t:saveState value="#{beanClienteDett}"/>
        <t:saveState value="#{beanCliente}"/>
        <br/>
      
        <table class="dettaglio">
            <tbody>                      
            
            <div class="storico">
                <strong>CLIENTE: <h:outputText  value=" #{beanCliente.ragioneSociale}"/></strong>        
            </div>
            
            <tr>        
                <td class="etichettaDettaglio"><strong><t:outputLabel for="data" value="Data"/></strong></td>
                <td><h:outputText value=" (gg/mm/aaaa)" style="font-size:6.5pt"/>
                    <br/>
                    <t:inputCalendar id="data" renderAsPopup="true" renderPopupButtonAsImage="true" popupDateFormat="dd/MM/yyyy" styleClass="campoTesto" value="#{beanClienteDett.data}" disabled="true">
                        <f:convertDateTime pattern="dd/MM/yyyy" type="both" timeZone="Europe/Rome"/>
                    </t:inputCalendar>
                    <h:message style="color: red" for="data" showDetail="true" showSummary="false" />
                </td>
            </tr> 
            <tr>                   
                <td colspan="7">
                <hr width="90%"></td>
            </tr> 
            <tr>   
                <td class="etichettaDettaglio"><strong><t:outputLabel for="fattCodice" value="Numero Fattura"/></strong></td>
                <td style="border: groove;" width="25%"><t:outputText id="fattCodice" value="#{beanClienteDett.beanFattura.codice}" styleClass="dettaglio_InputText" >
                </t:outputText>
                <br/><h:message style="color: red" for="fattCodice" showDetail="true" showSummary="false" /></td>
                <td colspan="2"></td>
                <td class="etichettaDettaglio"><strong><t:outputLabel for="tipoPagamento" value="Tipo Pagamento"/></strong></td>
                <td style="border: groove;"><t:outputText id="tipoPagamento" value="#{beanClienteDett.beanFattura.beanTipoPagamento.descrizione}" styleClass="dettaglio_InputText" >
                </t:outputText>
                <br/><h:message style="color: red" for="tipoPagamento" showDetail="true" showSummary="false" /></td>
            </tr>              
                    
            <tr>   
                <td class="etichettaDettaglio">  <strong> <t:outputLabel for="sconto" value="Sconto"/> </strong>  </td> 
                <td style="border: groove;"> <t:outputText id="sconto" value="#{beanClienteDett.beanFattura.sconto}" styleClass="dettaglio_InputText" />
                <h:message style="color: red" for="sconto" showDetail="true" showSummary="false" /> </td> 
                <td colspan="2"></td>
                <td class="etichettaDettaglio">  <strong> <t:outputLabel for="imponibile" value="Imponibile"/> </strong>  </td> 
                <td style="border: groove;"> <t:outputText id="imponibile" value="#{beanClienteDett.beanFattura.imponibile}" styleClass="dettaglio_InputText" />
                <h:message style="color: red" for="imponibile" showDetail="true" showSummary="false" /> </td> 
            </tr>  
            
            <tr>   
                <td class="etichettaDettaglio">  <strong> <t:outputLabel for="iva2" value="Iva"/> </strong>  </td> 
                <td style="border: groove;"> <t:outputText id="iva2" value="#{beanClienteDett.beanFattura.iva}" styleClass="dettaglio_InputText"/>
                <h:message style="color: red" for="iva2" showDetail="true" showSummary="false" /> </td> 
                <td colspan="2"></td>
                <td class="etichettaDettaglio">  <strong> <t:outputLabel for="totale" value="Totale"/> </strong>  </td> 
                <td style="border: groove;"> <t:outputText id="totale" value="#{beanClienteDett.beanFattura.totale}" styleClass="dettaglio_InputText"/>
                <h:message style="color: red" for="totale" showDetail="true" showSummary="false" /></td> 
            </tr>             
        </table>
        
        <table width="750px">
            <tr>
                <td>
                    <hr style="margin-left: 6px">
                </td>
            </tr>
        </table>
        
        <table class="dettaglio" >
            <div class="storico">
                <strong>DATI RATE</strong>        
            </div>
            
            <tr>               
                <td class="etichettaDettaglio"><strong> <t:outputLabel value="Acconto"/> </strong> </td>                
                                               
                <td> 
                    <br/>
                    <t:inputText id="acconto" value="#{beanClienteDett.beanFattura.acconto}" styleClass="dettaglio_InputText" size="10" maxlength="10" required="false" disabled="true">
                    </t:inputText>                
                    <br/> 
                    <h:message style="color: red" for="acconto" showDetail="true" showSummary="false" />
                </td>                        
            </tr>    
            
            <tr>               
                <td class="etichettaDettaglio"><strong> <t:outputLabel value="Prima/Unica Rata"/> </strong> </td>
                <td> <h:outputText value="Data" style="font-size:6.5pt"/>
                    <br/> 
                    <t:inputCalendar id="data1" renderAsPopup="true" renderPopupButtonAsImage="true" popupDateFormat="dd/MM/yyyy" size="10" styleClass="campoTesto" value="#{beanClienteDett.beanFattura.data1}" disabled="true">
                        <f:convertDateTime pattern="dd/MM/yyyy" type="both" timeZone="Europe/Rome"/>
                    </t:inputCalendar>
                    <br/> 
                    <h:message style="color: red" for="data1" showDetail="true" showSummary="false" />
                </td>
                                               
                <td> <h:outputText value="Importo" style="font-size:6.5pt"/>
                    <br/>
                    <t:inputText id="importo1" value="#{beanClienteDett.beanFattura.importo1}" styleClass="dettaglio_InputText" size="10" maxlength="10" required="false" disabled="true">
                    </t:inputText>                
                    <br/> 
                    <h:message style="color: red" for="importo1" showDetail="true" showSummary="false" />
                </td>
                        
                <td> <h:outputText value="Pagato" style="font-size:6.5pt"/>
                    <br/>
                    <t:selectOneRadio id="pagato1" value="#{beanClienteDett.beanFattura.pagato1}" disabled="true">
                        <f:selectItem itemValue="S" itemLabel="Si"/>
                        <f:selectItem itemValue="N" itemLabel="No"/>                    
                    </t:selectOneRadio>
                </td>
            </tr>                 
                
            <tr>
                <td class="etichettaDettaglio"><strong> <t:outputLabel  value="Seconda Rata"/> </strong> </td>
                <td> <h:outputText value="Data" style="font-size:6.5pt"/>
                    <br/> 
                    <t:inputCalendar id="data2" renderAsPopup="true" renderPopupButtonAsImage="true" popupDateFormat="dd/MM/yyyy" size="10" styleClass="campoTesto" value="#{beanClienteDett.beanFattura.data2}" disabled="true">
                        <f:convertDateTime pattern="dd/MM/yyyy" type="both" timeZone="Europe/Rome"/>
                    </t:inputCalendar>
                    <br/> 
                    <h:message style="color: red" for="data2" showDetail="true" showSummary="false" />
                </td>
                                               
                <td> <h:outputText value="Importo" style="font-size:6.5pt"/>
                    <br/>
                    <t:inputText id="importo2" value="#{beanClienteDett.beanFattura.importo2}" styleClass="dettaglio_InputText" size="10" maxlength="10" required="false" disabled="true">
                    </t:inputText>                
                    <br/> 
                    <h:message style="color: red" for="importo2" showDetail="true" showSummary="false" />
                </td>
                        
                <td> <h:outputText value="Pagato" style="font-size:6.5pt"/>
                    <br/>
                    <t:selectOneRadio id="pagato2" value="#{beanClienteDett.beanFattura.pagato2}" disabled="true">
                        <f:selectItem itemValue="S" itemLabel="Si"/>
                        <f:selectItem itemValue="N" itemLabel="No"/>                    
                    </t:selectOneRadio>
                </td>
            </tr>        
 
            <tr>
                <td class="etichettaDettaglio"><strong> <t:outputLabel  value="Terza Rata"/></strong> </td>
                <td> <h:outputText value="Data" style="font-size:6.5pt"/>
                    <br/> 
                    <t:inputCalendar id="data3" renderAsPopup="true" renderPopupButtonAsImage="true" popupDateFormat="dd/MM/yyyy" size="10" styleClass="campoTesto" value="#{beanClienteDett.beanFattura.data3}" disabled="true">
                        <f:convertDateTime pattern="dd/MM/yyyy" type="both" timeZone="Europe/Rome"/>
                    </t:inputCalendar>
                    <br/> 
                    <h:message style="color: red" for="data3" showDetail="true" showSummary="false" />
                </td>
                                               
                <td> <h:outputText value="Importo" style="font-size:6.5pt"/>
                    <br/>
                    <t:inputText id="importo3" value="#{beanClienteDett.beanFattura.importo3}" styleClass="dettaglio_InputText" size="10" maxlength="10" required="false" disabled="true">
                    </t:inputText>                
                    <br/> 
                    <h:message style="color: red" for="importo3" showDetail="true" showSummary="false" />
                </td>
                        
                <td> <h:outputText value="Pagato" style="font-size:6.5pt"/>
                    <br/>
                    <t:selectOneRadio id="pagato3" value="#{beanClienteDett.beanFattura.pagato3}" disabled="true">
                        <f:selectItem itemValue="S" itemLabel="Si"/>
                        <f:selectItem itemValue="N" itemLabel="No"/>                    
                    </t:selectOneRadio>
                </td>
            </tr>     
                
            <tr>
                <td class="etichettaDettaglio"><strong><t:outputLabel  value="Quarta Rata"/> </strong> </td>
                <td> <h:outputText value="Data" style="font-size:6.5pt"/>
                    <br/> 
                    <t:inputCalendar id="data4" renderAsPopup="true" renderPopupButtonAsImage="true" popupDateFormat="dd/MM/yyyy" size="10" styleClass="campoTesto" value="#{beanClienteDett.beanFattura.data4}" disabled="true">
                        <f:convertDateTime pattern="dd/MM/yyyy" type="both" timeZone="Europe/Rome"/>
                    </t:inputCalendar>
                    <br/> 
                    <h:message style="color: red" for="data4" showDetail="true" showSummary="false" />
                </td>
                                               
                <td> <h:outputText value="Importo" style="font-size:6.5pt"/>
                    <br/>
                    <t:inputText id="importo4" value="#{beanClienteDett.beanFattura.importo4}" styleClass="dettaglio_InputText" size="10" maxlength="10" required="false" disabled="true">
                    </t:inputText>                
                    <br/> 
                    <h:message style="color: red" for="importo4" showDetail="true" showSummary="false" />
                </td>
                        
                <td> <h:outputText value="Pagato" style="font-size:6.5pt"/>
                    <br/>
                    <t:selectOneRadio id="pagato4" value="#{beanClienteDett.beanFattura.pagato4}" disabled="true">
                        <f:selectItem itemValue="S" itemLabel="Si"/>
                        <f:selectItem itemValue="N" itemLabel="No"/>                    
                    </t:selectOneRadio>
                </td>
            </tr>
        </table>
        <br/>
        <t:inputHidden value="#{beanClienteDett.id}"/>
        <table bgcolor="#FFFFFF" width="750px">
            <tr>     
                <td>
                    <h:commandLink styleClass="commandLink_Style" dir="RTL" action="benvenuto" immediate="true">
                        <t:graphicImage url="/image/go-home.png" border="0"/>
                    </h:commandLink>              
                </td>   
                <td>
                    <h:commandLink action="#{dettaglioClienteDett.primo}"  rendered="#{beanClienteDett.id ne null}" >
                        <t:graphicImage url="image/primo.png" border="0" title="Vai al primo elemento"/>
                        <f:param name="bean" value="beanClienteDett"/>                        
                        <f:param name="id" value="#{beanClienteDett.id}"/>                 
                    </h:commandLink>
                </td>
                <td>
                    <h:commandLink action="#{dettaglioClienteDett.precedente}" rendered="#{beanClienteDett.id ne null}" >
                        <t:graphicImage url="image/indietro.png" border="0" title="Indietro"/>
                        <f:param name="bean" value="beanClienteDett"/>                        
                        <f:param name="id" value="#{beanClienteDett.id}"/>     
                    </h:commandLink>
                </td>
                <td>
                    <h:commandLink action="#{dettaglioClienteDett.successivo}" rendered="#{beanClienteDett.id ne null}" >
                        <t:graphicImage url="image/avanti.png" border="0" title="Avanti"/>
                        <f:param name="bean" value="beanClienteDett"/>                        
                        <f:param name="id" value="#{beanClienteDett.id}"/>      
                    </h:commandLink>
                </td>
                <td>
                    <h:commandLink action="#{dettaglioClienteDett.ultimo}" rendered="#{beanClienteDett.id ne null}" >
                        <t:graphicImage url="image/ultimo.png" border="0" title="Vai all'ultimo elemento"/>
                        <f:param name="bean" value="beanClienteDett"/>                        
                        <f:param name="id" value="#{beanClienteDett.id}"/>         
                    </h:commandLink>
                </td>
                <td>
                    <h:commandLink  title="LISTA" id="lista" action="#{dettaglioClienteDett.lista}" rendered="#{beanClienteDett.id ne null}" >
                        <t:graphicImage url="image/lista.png" border="0" title="Carica lista" style="width:32px; height:32px"/>
                        <f:param name="bean" value="ClienteDett" />
                    </h:commandLink>
                </td>
                <td>
                    <h:commandLink  title="Torna Master" id="tornaMaster" action="#{dettaglioClienteDett.tornaMaster}" immediate="true">
                        <t:graphicImage url="image/undo.png" border="0" title="Torna Master"/>
                        <f:param name="beanPadre" value="beanCliente" />
                    </h:commandLink>
                </td>
                <td>
                    <h:commandLink dir="RTL" title="Carica Fattura" action="#{dettaglioClienteDett.caricaFattura}">
                        <t:graphicImage url="/image/viewmag.png" border="0"/>
                        <f:param name="idBean" value="#{beanClienteDett.beanFattura.id}" />
                    </h:commandLink>
                </td>
            </tr>
        </table>
    </h:form> 
   
    <h:form id="erroriDataBase" rendered="false">
        <f:verbatim><table><td align="left" class="messaggiErrore" height="2px"></f:verbatim>           
        <h:messages style="color: red" showDetail="true" showSummary="false"/>
        <f:verbatim></td></table></f:verbatim>
    </h:form>     
    
    <jsp:include page="/piePagina.jsp"/>      
</f:view>
